]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overviewControls: Use a custom layout to catch all geometry changes
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 13 Sep 2013 07:34:13 +0000 (09:34 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 13 Sep 2013 11:50:31 +0000 (13:50 +0200)
We currently update workspaces geometry when we are notified about
allocation changes of the overview group; however as the geometry
is based on stage coordinates, we miss notifications when the
allocation relative to the parent is unchanged, which happens when
the primary monitor's position changes but not its resolution.
Use a custom layout manager to give us a signal that is emitted
reliably.

https://bugzilla.gnome.org/show_bug.cgi?id=708009

js/ui/overviewControls.js

index 12ab2aa97e90a41957dc1ee4c1ef614dbe405a06..c16c4ac54c37ef82789883d8e9489daa4fcf5bf1 100644 (file)
@@ -504,6 +504,17 @@ const MessagesIndicator = new Lang.Class({
     }
 });
 
+const ControlsLayout = new Lang.Class({
+    Name: 'ControlsLayout',
+    Extends: Clutter.BinLayout,
+    Signals: { 'allocation-changed': { flags: GObject.SignalFlags.RUN_LAST } },
+
+    vfunc_allocate: function(container, box, flags) {
+        this.parent(container, box, flags);
+        this.emit('allocation-changed');
+    }
+});
+
 const ControlsManager = new Lang.Class({
     Name: 'ControlsManager',
 
@@ -524,7 +535,8 @@ const ControlsManager = new Lang.Class({
         this._indicator = new MessagesIndicator(this.viewSelector);
         this.indicatorActor = this._indicator.actor;
 
-        this.actor = new St.Widget({ layout_manager: new Clutter.BinLayout(),
+        let layout = new ControlsLayout();
+        this.actor = new St.Widget({ layout_manager: layout,
                                      reactive: true,
                                      x_expand: true, y_expand: true,
                                      clip_to_allocation: true });
@@ -539,7 +551,7 @@ const ControlsManager = new Lang.Class({
                                                    expand: true });
         this._group.add_actor(this._thumbnailsSlider.actor);
 
-        this._group.connect('notify::allocation', Lang.bind(this, this._updateWorkspacesGeometry));
+        layout.connect('allocation-changed', Lang.bind(this, this._updateWorkspacesGeometry));
 
         Main.overview.connect('showing', Lang.bind(this, this._updateSpacerVisibility));
         Main.overview.connect('item-drag-begin', Lang.bind(this,